#!/bin/sh  
ifconfig wlan0 192.168.2.1  
/etc/init.d/hostapd restart
/etc/init.d/dnsmasq restart  
iptables -F  
iptables -X  
iptables -t nat -F  
iptables -t nat -X  
iptables -t nat -APOSTROUTING -s 192.168.2.0/24 -o eth0 -j MASQUERADE  
iptables -A FORWARD -s 192.168.2.0/24 -o eth0 -j ACCEPT  
iptables -A FORWARD -d 192.168.2.0/24 -m conntrack --ctstate ESTABLISHED,RELATED -i eth0 -j ACCEPT 
